import {NavLink, useLocation} from "react-router-dom";

function LeftNav() {
    const url_data = useLocation()
    console.log(url_data.state)
    return (
        <div className={"left-nav"}>
            <NavLink to={"/"}>首页</NavLink><br/>
            <NavLink state={{id:10,name:"小明"}} to={"/goods"}>产品</NavLink><br/>
            <NavLink to={"/shoppingCart"}>购物车</NavLink><br/>
        </div>
    );
}

export default LeftNav;